DATA SEGMENT 
A DB 5FH
DATA  ENDS 

CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV DX,DATA
MOV DS,DX
MOV AL,A
MOV CL,4
ROL AL,CL
CALL CHANGE
MOV AL,A
AND AL,0FH
CALL CHANGE
MOV AH,4CH
INT 21H
CHANGE PROC NEAR
    AND AL,0FH
    ADD AL,'0'
    CMP AL,'9'
    JBE NEXT1
    ADD AL,'A'-'9'
    DEC AL
    NEXT1:MOV DL,AL
    MOV AH,2
    INT 21H 
    RET
CHANGE ENDP 
CODE ENDS

END START